package com.appwoo.txtws.activity;

import android.content.Intent;
import android.content.SharedPreferences;
import android.content.SharedPreferences.Editor;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.RadioButton;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;
import android.widget.TabHost;
import android.widget.TabHost.TabSpec;
import com.appwoo.txtws.app.AppTabActivity;
import com.appwoo.txtws.component.GetDateTime;
import com.appwoo.txtws.service.RQNetLock;

public class MarketTabForChildActivity extends AppTabActivity
{
  private RadioButton rbDownload;
  private RadioButton rbRecom;
  private RadioButton rbType;
  private RadioGroup rg;
  private TabHost tabHost;

  private void closeCurrentActivity()
  {
    finish();
  }

  private void initActionBar()
  {
    setBarHomeDrawable(getResources().getDrawable(2130837977));
    setBarTitle(getResources().getString(2131427346));
    setBarBackOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MarketTabForChildActivity.this.closeCurrentActivity();
      }
    });
    setBarHomeOnClickListener(new View.OnClickListener()
    {
      public void onClick(View paramAnonymousView)
      {
        MarketTabForChildActivity.this.hideBarHome();
        if (MarketTabForChildActivity.this.rbRecom.isChecked())
          MarketTabForChildActivity.this.rbRecom.setChecked(false);
        while (true)
        {
          MarketTabForChildActivity.this.hideBarHome();
          MarketTabForChildActivity.this.tabHost.setCurrentTabByTag("tab4");
          return;
          if (MarketTabForChildActivity.this.rbType.isChecked())
            MarketTabForChildActivity.this.rbType.setChecked(false);
        }
      }
    });
  }

  private void initView()
  {
    this.rbRecom = ((RadioButton)findViewById(2131493271));
    this.rbType = ((RadioButton)findViewById(2131493319));
    this.rbDownload = ((RadioButton)findViewById(2131493320));
    this.tabHost = getTabHost();
    this.tabHost.addTab(this.tabHost.newTabSpec("tab1").setIndicator("").setContent(new Intent(this, RecomAppForChildActivity.class)));
    this.tabHost.addTab(this.tabHost.newTabSpec("tab2").setIndicator("").setContent(new Intent(this, SoftTypeForChildActivity.class)));
    this.tabHost.addTab(this.tabHost.newTabSpec("tab3").setIndicator("").setContent(new Intent(this, StudyYDActivity.class)));
    this.tabHost.addTab(this.tabHost.newTabSpec("tab4").setIndicator("").setContent(new Intent(this, AllAppForChildActivity.class)));
    this.rg = ((RadioGroup)findViewById(2131493318));
    this.rg.setOnCheckedChangeListener(new RadioGroup.OnCheckedChangeListener()
    {
      public void onCheckedChanged(RadioGroup paramAnonymousRadioGroup, int paramAnonymousInt)
      {
        MarketTabForChildActivity.this.showBarHome();
        switch (paramAnonymousInt)
        {
        default:
          return;
        case 2131493271:
          MarketTabForChildActivity.this.tabHost.setCurrentTabByTag("tab1");
          return;
        case 2131493319:
          MarketTabForChildActivity.this.tabHost.setCurrentTabByTag("tab2");
          return;
        case 2131493320:
        }
        MarketTabForChildActivity.this.tabHost.setCurrentTabByTag("tab3");
      }
    });
    if (MainActivity.intMarketRecdCount > 0)
    {
      this.rbDownload.setChecked(true);
      return;
    }
    this.rbRecom.setChecked(true);
  }

  protected void backKeyCallBack()
  {
    closeCurrentActivity();
  }

  public void onBackPressed()
  {
    closeCurrentActivity();
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903162);
    initView();
    initActionBar();
    if (!"3".equals(new RQNetLock(this).getNetCmd()))
    {
      alertMessage("断网状态下不可操作");
      finish();
    }
  }

  protected void onDestroy()
  {
    SharedPreferences.Editor localEditor = getSharedPreferences("sys", 0).edit();
    localEditor.putString("recddate", GetDateTime.getDateTime());
    localEditor.commit();
    super.onDestroy();
  }

  protected void onPause()
  {
    if (MainActivity.intMarketRecdCount > 0)
    {
      MainActivity.isRefreshMarket = Boolean.valueOf(true);
      MainActivity.intMarketRecdCount = 0;
    }
    super.onPause();
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.activity.MarketTabForChildActivity
 * JD-Core Version:    0.6.2
 */